; Music of Jet 37 (1990) (Black System)
; Ripped by Megachur the 20/03/2009

; Need System Vectors

	write "JET37.BIN"

music_date_rip	equ &1439
music_adr	equ &93ce
first_theme	equ 1
last_theme	equ 1	; 1 -> 1

	read "music_header_v1_0.asm"
	
.l93ce
	db #0e,#00,#01,#02,#02,#65,#02,#02
	db #65,#02,#02,#02,#02,#00,#14,#00
	db #a9,#01,#00,#19,#00,#02,#00,#00
	db #0c,#16,#04,#d5,#00,#5c,#0f,#05
	db #00,#00,#00,#05,#00,#00,#00,#05
	db #00,#00,#00,#05,#02,#00,#00,#0c
	db #02,#00,#00,#05,#00,#00,#00,#05
	db #00,#02,#00,#00,#0c,#16,#00,#05
	db #00,#02,#00,#00,#0c,#16,#00,#05
	db #00,#00,#00,#05,#00,#02,#00,#00
	db #0c,#16,#00,#05,#00,#00,#00,#05
	db #00,#02,#00,#00,#0c,#16,#00,#05
	db #00,#02,#00,#00,#0c,#02,#00,#05
	db #00,#00,#00,#05,#00,#02,#00,#00
	db #0c,#16,#00,#05,#00,#00,#00,#05
	db #00,#02,#00,#00,#0c,#16,#04,#9f
	db #00,#c0,#0f,#05,#00,#00,#00,#05
	db #00,#00,#00,#05,#02,#00,#00,#0c
	db #0d,#00,#00,#05,#02,#00,#00,#0c
	db #06,#00,#00,#05,#00,#00,#00,#05
	db #00,#02,#00,#00,#0c,#16,#00,#05
	db #00,#02,#00,#00,#0c,#16,#00,#05
	db #00,#00,#00,#05,#00,#02,#00,#00
	db #0c,#16,#00,#05,#00,#00,#00,#05
	db #00,#02,#00,#00,#0c,#16,#00,#05
	db #00,#02,#00,#00,#0c,#02,#00,#05
	db #00,#00,#00,#05,#00,#02,#00,#00
	db #0c,#16,#00,#05,#00,#00,#00,#05
	db #00,#00,#04,#d5,#00,#5c,#0f,#05
	db #00,#00,#00,#05,#00,#00,#00,#05
	db #02,#00,#00,#0c,#0d,#00,#00,#05
	db #02,#00,#00,#0c,#06,#00,#00,#05
	db #00,#00,#00,#05,#00,#02,#00,#00
	db #0c,#16,#00,#05,#00,#02,#00,#00
	db #0c,#16,#00,#05,#00,#00,#00,#05
	db #00,#02,#00,#00,#0c,#16,#00,#05
	db #00,#00,#00,#05,#00,#02,#00,#00
	db #0c,#16,#00,#05,#00,#02,#00,#00
	db #0c,#02,#00,#05,#00,#00,#00,#05
	db #00,#02,#00,#00,#0c,#16,#00,#05
	db #00,#00,#00,#05,#00,#00,#04,#9f
	db #00,#c0,#0f,#05,#00,#00,#00,#05
	db #00,#00,#00,#05,#02,#00,#00,#0c
	db #0d,#00,#00,#05,#02,#00,#00,#0c
	db #06,#00,#00,#05,#00,#00,#00,#05
	db #00,#02,#00,#00,#0c,#16,#00,#05
	db #00,#02,#00,#00,#0c,#16,#00,#05
	db #00,#00,#00,#05,#00,#02,#00,#00
	db #0c,#16,#00,#05,#00,#00,#00,#05
	db #00,#02,#00,#00,#0c,#16,#00,#05
	db #00,#02,#00,#00,#0c,#02,#00,#05
	db #00,#00,#00,#05,#00,#02,#00,#00
	db #0c,#16,#00,#05,#00,#00,#00,#05
	db #ff,#01,#53,#03,#0c,#05,#02,#00
	db #00,#0c,#16,#04,#d5,#00,#5c,#0f
	db #05,#00,#00,#00,#05,#00,#00,#00
	db #05,#00,#00,#00,#05,#02,#00,#00
	db #0c,#02,#00,#00,#05,#00,#00,#00
	db #05,#01,#66,#01,#0c,#05,#02,#00
	db #00,#0c,#16,#00,#05,#01,#66,#01
	db #0c,#05,#02,#00,#00,#0c,#16,#00
	db #05,#00,#00,#00,#05,#01,#66,#01
	db #0c,#05,#02,#00,#00,#0c,#16,#00
	db #05,#00,#00,#00,#05,#01,#cc,#02
	db #0c,#05,#02,#00,#00,#0c,#16,#00
	db #05,#01,#cc,#02,#0c,#05,#02,#00
	db #00,#0c,#02,#00,#05,#00,#00,#00
	db #05,#01,#cc,#02,#0c,#05,#00,#00
	db #05,#00,#00,#00,#05,#01,#7e,#02
	db #0c,#05,#00,#04,#9f,#00,#c0,#0f
	db #05,#00,#00,#00,#05,#00,#00,#00
	db #05,#02,#00,#00,#0c,#0d,#00,#00
	db #05,#02,#00,#00,#0c,#06,#00,#00
	db #05,#00,#00,#00,#05,#01,#de,#01
	db #0c,#05,#02,#00,#00,#0c,#16,#00
	db #05,#01,#de,#01,#0c,#05,#02,#00
	db #00,#0c,#16,#00,#05,#00,#00,#00
	db #05,#01,#de,#01,#0c,#05,#02,#00
	db #00,#0c,#16,#00,#05,#00,#00,#00
	db #05,#01,#bc,#03,#0c,#05,#02,#00
	db #00,#0c,#16,#00,#05,#01,#bc,#03
	db #0c,#05,#02,#00,#00,#0c,#02,#00
	db #05,#00,#00,#00,#05,#01,#53,#03
	db #0c,#05,#00,#00,#05,#00,#00,#00
	db #05,#01,#53,#03,#0c,#05,#00,#04
	db #d5,#00,#5c,#0f,#05,#00,#00,#00
	db #05,#00,#00,#00,#05,#02,#00,#00
	db #0c,#0d,#00,#00,#05,#02,#00,#00
	db #0c,#06,#00,#00,#05,#00,#00,#00
	db #05,#01,#66,#01,#0c,#05,#02,#00
	db #00,#0c,#16,#00,#05,#01,#66,#01
	db #0c,#05,#02,#00,#00,#0c,#16,#00
	db #05,#00,#00,#00,#05,#01,#66,#01
	db #0c,#05,#02,#00,#00,#0c,#16,#00
	db #05,#00,#00,#00,#05,#01,#cc,#02
	db #0c,#05,#02,#00,#00,#0c,#16,#00
	db #05,#01,#cc,#02,#0c,#05,#02,#00
	db #00,#0c,#02,#00,#05,#00,#00,#00
	db #05,#01,#cc,#02,#0c,#05,#00,#00
	db #05,#00,#00,#00,#05,#01,#7e,#02
	db #0c,#05,#00,#04,#9f,#00,#c0,#0f
	db #05,#00,#00,#00,#05,#00,#00,#00
	db #05,#02,#00,#00,#0c,#0d,#00,#00
	db #05,#02,#00,#00,#0c,#06,#00,#00
	db #05,#00,#00,#00,#05,#01,#aa,#01
	db #0c,#05,#02,#00,#00,#0c,#16,#00
	db #05,#01,#aa,#01,#0c,#05,#02,#00
	db #00,#0c,#16,#00,#05,#00,#00,#00
	db #05,#01,#aa,#01,#0c,#05,#02,#00
	db #00,#0c,#16,#00,#05,#00,#00,#00
	db #05,#01,#53,#03,#0c,#05,#02,#00
	db #00,#0c,#16,#00,#05,#01,#38,#02
	db #0c,#05,#02,#00,#00,#0c,#02,#00
	db #05,#00,#00,#00,#05,#01,#38,#02
	db #0c,#05,#00,#00,#05,#00,#00,#00
	db #05,#ff
;
.real_init_music
;
	push af
	push de
	call #bca7
	pop de
	pop af
	cp #00
	ld hl,l9a1c
	jp z,#bcdd
	ld (l9a32),de
	ld a,(de)
	ld (l9a34),a
	ld a,#01
	ld hl,l9a36
	call #bcbc
	ld a,#01
	ld hl,l9a40
	call #bcbf
	ld a,#02
	ld hl,l9a47
	call #bcbc
	ld a,#02
	ld hl,l9a4b
	call #bcbf
	ld a,#03
	ld hl,l9a52
	call #bcbc
	ld a,#03
	ld hl,l9a59
	call #bcbf
	ld a,#04
	ld hl,l9a60
	call #bcbc
	ld a,#05
	ld hl,l9a6d
	call #bcbc
	ld a,#06
	ld hl,l9a71
	call #bcbc
	ld a,#07
	ld hl,l9a7b
	call #bcbc
	ld a,#08
	ld hl,l9a82
	call #bcbc
	xor a
	ld (l9a30),a
	ld (l9a31),a
	ld (l9931),a
	ld a,#01
	ld (l9a2b),a
	ld hl,(l9a32)
	inc hl
	ld (l9a2e),hl
	call l98b5
	ld hl,l9a1c
	ld bc,#8100
	ld de,l97fc
	jp #bcd7
;
.play_music
.l97fc
;
	di
	push af
	push de
	push hl
	push bc
	push ix
	push iy
	call l9813
	pop iy
	pop ix
	pop bc
	pop hl
	pop de
	pop af
	ei
	reti
.l9813
	ld a,(l9a2b)
	dec a
	cp #00
	jp z,l9820
	ld (l9a2b),a
	ret
.l9820
	ld b,#03
	ld ix,(l9a2c)
.l9826
	push bc
	push ix
	ld de,#0001
	ld a,(ix+#00)
	cp #00
	jp z,l983a
	call l9891
	ld de,#0005
.l983a
	pop ix
	pop bc
	add ix,de
	djnz l9826
	ld a,(ix+#00)
	inc a
	ld (l9a2b),a
	inc ix
	ld (l9a2c),ix
	ld a,(ix+#00)
	cp #ff
	ret nz
	xor a
	ld (l9931),a
	jp l98b5
.l985b
	ld a,#0f
	ld iy,l9956
	jp l9876
.l9864
	ld a,#0f
	ld iy,l995f
	jp l9876
.l986d
	ld a,#0f
	ld iy,l9983
	jp l9876
.l9876
	push af
	push ix
	push iy
	ld (iy+#06),a
	call l9903
	pop iy
	pop ix
	pop af
	dec a
	cp #09
	jp nz,l9876
	ld (iy+#06),#0f
	ret
.l9891
	ld a,(ix+#04)
	cp #10
	jp z,l985b
	cp #11
	jp z,l9864
	cp #13
	jp z,l986d
	ld iy,l9956
.l98a7
	dec a
	cp #00
	jp z,l9903
	ld de,#0009
	add iy,de
	jp l98a7
.l98b5
	ld hl,(l9a2e)
	inc hl
	ld a,(hl)
	cp #00
	jp nz,l98cf
	xor a
	ld (l9a30),a
	ld (l9a31),a
	ld (l9931),a
	ld hl,(l9a32)
	inc hl
	inc hl
	ld a,(hl)
.l98cf
	ld (l9a2e),hl
	cp #64
	jp z,l993e
	cp #65
	jp z,l9946
	ld ix,(l9a34)
	ld de,(l9a32)
	add ix,de
.l98e6
	dec a
	cp #00
	jp z,l98f4
	ld de,#0002
	add ix,de
	jp l98e6
.l98f4
	ld l,(ix+#00)
	ld h,(ix+#01)
	ld de,(l9a32)
	add hl,de
	ld (l9a2c),hl
	ret
.l9903
	ld a,(ix+#00)
	ld (iy+#00),a
	ld l,(ix+#01)
	ld h,(ix+#02)
	call l9936
	ld (iy+#03),l
	ld (iy+#04),h
	ld a,(ix+#03)
	ld (iy+#07),a
	ld (iy+#08),#00
	push iy
	pop hl
	ld a,(l9a31)
	cp #00
	jp z,#bcaa
	ld a,(ix+#00)
.l9931 equ $ + 1
	cp #00
	jp nz,#bcaa
	ret
.l9936
	ld a,(l9a30)
	cp #00
	ret z
	add hl,hl
	ret
.l993e
	ld a,#01
	ld (l9a30),a
	jp l98b5
.l9946
	ld a,#01
	ld (l9a31),a
	inc hl
	ld a,(hl)
	ld (l9931),a
	ld (l9a2e),hl
	jp l98b5
.l9956
	db #00,#01,#00,#00,#00,#00,#0f,#00
.l995f equ $ + 1
	db #00,#00,#02,#00,#00,#00,#05,#0f
	db #00,#00,#00,#03,#00,#00,#00,#00
	db #0f,#00,#00,#00,#04,#00,#00,#00
	db #00,#00,#00,#00,#00,#02,#00,#00
.l9983 equ $ + 5
	db #00,#00,#0f,#00,#00,#00,#02,#00
	db #00,#00,#0f,#0f,#00,#00,#00,#02
	db #00,#00,#00,#19,#0f,#00,#00,#00
	db #05,#00,#00,#00,#05,#0f,#00,#00
	db #00,#05,#00,#00,#00,#0f,#0f,#00
	db #00,#00,#05,#00,#00,#00,#0f,#0f
	db #00,#00,#00,#05,#00,#00,#00,#00
	db #0f,#00,#00,#00,#03,#01,#00,#00
	db #00,#0f,#00,#00,#00,#06,#00,#00
	db #00,#01,#00,#00,#00,#00,#00,#02
	db #00,#00,#00,#0c,#00,#00,#00,#03
	db #02,#00,#00,#00,#0f,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#04,#02,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#03,#03,#00,#00
	db #00,#00,#00,#00,#00,#07,#00,#00
	db #00,#00,#00,#00,#00,#00,#08,#00
.l9a1c equ $ + 6
	db #00,#00,#03,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
.l9a2c equ $ + 6
.l9a2b equ $ + 5
	db #00,#00,#00,#00,#00,#00,#00,#00
.l9a31 equ $ + 3
.l9a30 equ $ + 2
.l9a2e
	db #00,#00,#00,#00
.l9a36 equ $ + 4
.l9a34 equ $ + 2
.l9a32
	db #00,#00,#00,#00,#03,#01,#00,#0a
.l9a40 equ $ + 6
	db #0a,#ff,#01,#01,#00,#0a,#82,#14
.l9a47 equ $ + 5
	db #01,#01,#14,#ff,#01,#01,#0f,#ff
.l9a4b equ $ + 1
	db #02,#82,#03,#01,#03,#03,#ff,#03
.l9a59 equ $ + 7
.l9a52
	db #02,#0a,#ff,#08,#05,#ff,#04,#03
.l9a60 equ $ + 6
	db #50,#01,#01,#14,#02,#01,#04,#01
	db #07,#01,#03,#02,#01,#01,#00,#02
.l9a71 equ $ + 7
.l9a6d equ $ + 3
	db #0a,#ff,#05,#01,#0f,#ff,#01,#03
	db #01,#0a,#01,#01,#00,#04,#05,#fe
.l9a7b equ $ + 1
	db #01,#02,#01,#0f,#05,#0a,#ff,#02
.l9a82
	db #02,#01,#0c,#01,#0c,#ff,#01,#00
	db #00,#00,#00,#00,#00,#00,#00
	
;org #7555
;
.init_music
;
	ld a,#01
	ld de,l93ce
	jp real_init_music	;9768

;
.game_name
	db "Jet 37",0
.game_year
	db "1990",0
.game_publisher
	db "Black System",0
.music_author
	db "",0
.music_comment
	db "",0

	read "music_end_v1_0.asm"
